<?php
/**
 * Created by PhpStorm.
 * User: gc
 * Date: 2018/1/11
 * Time: 7:15
 */

namespace Adapter\MediaPlayer;


class AudioPlayer implements MediaPlayer
{
    private $mediaAdapter = null;

    function play($audioType, $fileName)
    {
        if('mp3' == $audioType) {
            echo 'Play mp3:' . $fileName . "\r\n";
        } elseif ('mp4' == $audioType || 'vlc' == $audioType) {
            $this->mediaAdapter = new MediaAdapter($audioType);
            $this->play($audioType, $fileName);
        } else {
            echo "类型不支持";
        }
    }

}